const http = uni.$u.http
function getConfig(config) {
    return {
        ...config,
        header: {
            Accept: 'application/json'
        }
    }
}
// post请求，获取菜单
export default {
    register: (data, config = {}) => http.post('/user/register', data), // 注册
    login: (data, config = {}) => http.post('/user/login', data), // 登录
    wxH5login: (data) => http.post('/user/wxH5login', data),
    // bannerDetail
    bannerList: (data, config = {}) => http.get('/banner/list', data),
    configList: (data, config = {}) => http.get('/config/list', data),
    // 获取用户信息
    getUserInfo: (id, config = {}) => http.get('/user/' + id),
    updateUserInfo: (data, config = {}) => http.put('/user/' + data.id, data),
    voteList: (data, config = {}) => http.get('/vote/list', data),
    groupList: (data, config = {}) => http.get('/group/list', data),
    createVote: (data, config = {}) => http.post('/vote', data),
    // 创建记录
    createRecord: (data, config = {}) => http.post('/record', data),
    // 获取访问记录
    recordList: (data, config = {}) => http.get('/record/list', data),
}
